package Servlets.employer;

import Dao.FettleDaoimpl;
import Entity.Fettle;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;

@WebServlet("/Eminvite")

public class Eminvite extends HttpServlet {

    private static final long serialVersionUID = 1L;

    public Eminvite() {

        super();

    }
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

// TODO Auto-generated method stub

        request.setCharacterEncoding("UTF-8");

        response.setCharacterEncoding("UTF-8");

        response.setContentType("text/html;charset=UTF-8");
        FettleDaoimpl de=new FettleDaoimpl();
        int eid = (int) request.getSession().getAttribute("seid");
        ArrayList<Fettle> allemp = null;

        try {

            allemp = (ArrayList<Fettle>)de.SearchAllinviteByEid(eid);

            request.setAttribute("allemp", allemp);

            request.getRequestDispatcher("/eminvite.jsp").forward(request, response);
        } catch (Exception e) {
// TODO Auto-generated catch block

            e.printStackTrace();

        }



    }



    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

// TODO Auto-generated method stub

        doGet(request, response);

    }


}